/**
 * @author zhoushengtao
 * @since 2013-11-12 上午10:38:29
 */

package com.jason.android.core.weather;

import org.json.JSONObject;

import java.io.Serializable;

public class WeatherInfo implements Serializable
{
    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    public String city;// 西安
    public String city_en;// xian
    public String date_y;// 2013年11月12日
    public String date;
    public String week;// 星期二
    public String fchh;// 08
    public String cityid;// 101110101
    // 從今天開始的未來5天天氣
    public String temp1;// 11℃~6℃
    public String temp2;// 14℃~6℃
    public String temp3;// 15℃~4℃
    public String temp4;// 16℃~5℃
    public String temp5;// 17℃~5℃
    public String temp6;// 16℃~4℃
    public String tempF1;// 51.8℉~42.8℉
    public String tempF2;// 57.2℉~42.8℉
    public String tempF3;// 59℉~39.2℉
    public String tempF4;// 60.8℉~41℉
    public String tempF5;// 62.6℉~41℉
    public String tempF6;// 60.8℉~39.2℉
    public String weather1;// 多云
    public String weather2;// 多云
    public String weather3;// 阴
    public String weather4;// 多云
    public String weather5;// 晴
    public String weather6;// 晴
    public String img1;// 1
    public String img2;// 99
    public String img3;// 1
    public String img4;// 99
    public String img5;// 2
    public String img6;// 99
    public String img7;// 1
    public String img8;// 99
    public String img9;// 0
    public String img10;// 99
    public String img11;// 0
    public String img12;// 99
    public String img_single;// 1
    public String img_title1;// 多云
    public String img_title2;// 多云
    public String img_title3;// 多云
    public String img_title4;// 多云
    public String img_title5;// 阴
    public String img_title6;// 阴
    public String img_title7;// 多云
    public String img_title8;// 多云
    public String img_title9;// 晴
    public String img_title10;// 晴
    public String img_title11;// 晴
    public String img_title12;// 晴
    public String img_title_single;// 多云
    public String wind1;// 西风小于3级
    public String wind2;// 西风小于3级
    public String wind3;// 西风小于3级
    public String wind4;// 西风小于3级
    public String wind5;// 西风小于3级
    public String wind6;// 西风小于3级
    public String fx1;// 西风
    public String fx2;// 西风
    public String fl1;// 小于3级
    public String fl2;// 小于3级
    public String fl3;// 小于3级
    public String fl4;// 小于3级
    public String fl5;// 小于3级
    public String fl6;// 小于3级

    public String index;// 较冷
    // 今天的穿衣指数
    public String index_d;// 建议着厚外套加毛衣等服装。年老体弱者宜着大衣、呢外套加羊毛衫。
    public String index48;// 较冷
    public String index48_d;// 建议着厚外套加毛衣等服装。年老体弱者宜着大衣、呢外套加羊毛衫。
    // 今天的紫外线指数
    public String index_uv;// 最弱
    public String index48_uv;// 最弱
    public String index_xc;// 适宜
    public String index_tr;// 适宜
    // 今天的舒适指数
    public String index_co;// 较舒适
    public String st1;// 11
    public String st2;// 5
    public String st3;// 14
    public String st4;// 6
    public String st5;// 16
    public String st6;// 3
    public String index_cl;// 适宜
    public String index_ls;// 基本适宜
    public String index_ag;// 极不易发

    public String jsonDataString = "";

    public void loadData(String json)
    {
        jsonDataString = json;
        JSONObject rootObject;
        try
        {
            rootObject = new JSONObject(json);
            JSONObject weatherinfo = new JSONObject(rootObject.optString("weatherinfo"));

            city = weatherinfo.optString("city","");
            city_en = weatherinfo.optString("city_en","");
            week = weatherinfo.optString("week","");
            date = weatherinfo.optString("date","");
            date_y = weatherinfo.optString("date_y","");
            fchh = weatherinfo.optString("fchh","");
            cityid = weatherinfo.optString("cityid","");

            tempF1 = weatherinfo.optString("tempF1","");
            tempF2 = weatherinfo.optString("tempF2","");
            tempF3 = weatherinfo.optString("tempF3","");
            tempF4 = weatherinfo.optString("tempF4","");
            tempF5 = weatherinfo.optString("tempF5","");
            tempF6 = weatherinfo.optString("tempF6","");
            weather1 = weatherinfo.optString("weather1","");
            weather2 = weatherinfo.optString("weather2","");
            weather3 = weatherinfo.optString("weather3","");
            weather4 = weatherinfo.optString("weather4","");
            weather5 = weatherinfo.optString("weather5","");
            weather6 = weatherinfo.optString("weather6","");
            temp1 = weatherinfo.optString("temp1","");
            temp2 = weatherinfo.optString("temp2","");
            temp3 = weatherinfo.optString("temp3","");
            temp4 = weatherinfo.optString("temp4","");
            temp5 = weatherinfo.optString("temp5","");
            temp6 = weatherinfo.optString("temp6","");
            img1 = weatherinfo.optString("img1","");
            img2 = weatherinfo.optString("img2","");
            img3 = weatherinfo.optString("img3","");
            img4 = weatherinfo.optString("img4","");
            img5 = weatherinfo.optString("img5","");
            img6 = weatherinfo.optString("img6","");
            img7 = weatherinfo.optString("img7","");
            img8 = weatherinfo.optString("img8","");
            img9 = weatherinfo.optString("img9","");
            img10 = weatherinfo.optString("img10","");
            img11 = weatherinfo.optString("img11","");
            img12 = weatherinfo.optString("img12","");
            img_single = weatherinfo.optString("img_single","");
            img_title1 = weatherinfo.optString("img_title1","");
            img_title2 = weatherinfo.optString("img_title2","");
            img_title3 = weatherinfo.optString("img_title3","");
            img_title4 = weatherinfo.optString("img_title4","");
            img_title5 = weatherinfo.optString("img_title5","");
            img_title6 = weatherinfo.optString("img_title6","");
            img_title7 = weatherinfo.optString("img_title7","");
            img_title8 = weatherinfo.optString("img_title8","");
            img_title9 = weatherinfo.optString("img_title9","");
            img_title10 = weatherinfo.optString("img_title10","");
            img_title11 = weatherinfo.optString("img_title11","");
            img_title12 = weatherinfo.optString("img_title12","");

            img_title_single = weatherinfo.optString("img_title_single","");

            wind1 = weatherinfo.optString("wind1","");// 西风小于3级
            wind2 = weatherinfo.optString("wind2","");// 西风小于3级
            wind3 = weatherinfo.optString("wind3","");// 西风小于3级
            wind4 = weatherinfo.optString("wind4","");// 西风小于3级
            wind5 = weatherinfo.optString("wind5","");// 西风小于3级
            wind6 = weatherinfo.optString("wind6","");// 西风小于3级
            fx1 = weatherinfo.optString("fx1","");// 西风
            fx2 = weatherinfo.optString("fx2","");// 西风
            fl1 = weatherinfo.optString("fl1","");// 小于3级
            fl2 = weatherinfo.optString("fl2","");// 小于3级
            fl3 = weatherinfo.optString("fl3","");// 小于3级
            fl4 = weatherinfo.optString("fl4","");// 小于3级
            fl5 = weatherinfo.optString("fl5","");// 小于3级
            fl6 = weatherinfo.optString("fl6","");// 小于3级

            index = weatherinfo.optString("index","");// 较冷
            // 今天的穿衣指数
            index_d = weatherinfo.optString("index_d","");// 建议着厚外套加毛衣等服装。年老体弱者宜着大衣、呢外套加羊毛衫。
            index48 = weatherinfo.optString("index48","");// 较冷
            index48_d = weatherinfo.optString("index48_d","");// 建议着厚外套加毛衣等服装。年老体弱者宜着大衣、呢外套加羊毛衫。
            // 今天的紫外线指数
            index_uv = weatherinfo.optString("index_uv","");// 最弱
            index48_uv = weatherinfo.optString("index48_uv","");// 最弱
            index_xc = weatherinfo.optString("index_xc","");// 适宜
            index_tr = weatherinfo.optString("index_tr","");// 适宜
            // 今天的舒适指数
            index_co = weatherinfo.optString("index_co","");// 较舒适
            st1 = weatherinfo.optString("st1","");// 11
            st2 = weatherinfo.optString("st2","");// 5
            st4 = weatherinfo.optString("st3","");// 14
            st4 = weatherinfo.optString("st4","");// 6
            st4 = weatherinfo.optString("st4","");// 16
            st6 = weatherinfo.optString("st6","");// 3
            index_cl = weatherinfo.optString("index_cl","");// 适宜
            index_ls = weatherinfo.optString("index_ls","");// 基本适宜
            index_ag = weatherinfo.optString("index_ag","");// 极不易发
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }

    @Override
    public String toString()
    {
        return jsonDataString;
    }

}
